Documentation > Services API > ServicesOutput > BuildHyperLinkList(List[PanelEntry],String,LinkListType,String,String,String,LinkListType,Int32)

BuildHyperLinkList

Called by RenderHyperLinkList to generate a HTML list of links (and/or sub-links)

public System.String BuildHyperLinkList(List[PanelEntry],String,LinkListType,String,String,String,LinkListType,Int32)


Returns

HTML list (or nested list) of links.

Parameters

NameDescriptionType
panels PanelEntry that contains the List Panel with the fields from ServicesInput.ShowHyperLink. List<PanelEntry>
fieldName Name given to the List Panel and ServicesInput.ShowHyperLink. System.String
listType Optional: Enumerated type LinkListType for parent list. CrownPeak.CMSAPI.Services.ServicesOutput+LinkListType
listParentClass Optional: Class of parent list System.String
listParentId Optional: ID of parent list System.String
childField Optional: Name of the child List Panel and ServicesInput.ShowHyperLink. System.String
childListType Optional: Enumerated type LinkListType for child list. CrownPeak.CMSAPI.Services.ServicesOutput+LinkListType
activeId Optional: Indicates the link of the current page, assuming the current page displays the list. System.Int32

Code Example

C#

Sample:

            List<PanelEntry> panels = asset.GetPanels("menu");
            Out.WriteLine( ServicesOutput.BuildHyperLinkList(panels, "menu", childField: "submenu"));
            /*returns and outputs:
            <ul>\n
              <li><a href="http://www.google.com" target="_self">Link 1 google</a>\r\n
                <ul>\n
                  <li><a href="http://www.google.com/maps" target="_self">sublink 1 maps</a></li>\r\n
                  <li><a href="http://www.google.com/mail" target="_self">sublink 2 mail</a></li>\r\n
                </ul>\n
              </li>\r\n
              <li><a href="http://www.yahoo.com" target="_self">Link 2 yahoo</a>\r\n
                <ul>\n
                  <li><a href="http://www.yahoo.com/mail" target="_self">sublink 1 mail</a></li>\r\n
                </ul>\n
              </li>\r\n
            </ul>\n
            \n
            */
            

Connect with Crownpeak